package com.woniuxy.main.provider;

import org.apache.ibatis.jdbc.SQL;

import com.woniuxy.main.pojo.Gym;


public class GymProvider {

	public String gymUpdate(Gym gym) {
		SQL sql = new SQL().UPDATE("gym").WHERE("uid=" + gym.getUid());
		
		if (gym.getGgrade() !=null) {
			sql.SET("ggrade=" + gym.getGgrade());
		}
		
		if (gym.getGname() != null && gym.getGname().length() != 0) {
			sql.SET("gname='" + gym.getGname() + "'");
		}

		if (gym.getGintroduction() != null && gym.getGintroduction().length() != 0) {
			sql.SET("gintroduction='" + gym.getGintroduction() + "'");
		}
		
		
		System.out.println("场馆的动态sql：" + sql.toString());
		
		return sql.toString();

	}
	
}
